﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="LevelOperation.aspx.cs" Inherits="masterPages_level_LevelOperation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<script type="text/javascript">
    function CusExtWin(visible, id) {
        if (document.layers) {
            theObj = eval("document.layers[\'" + id + "\']");
            if (theObj) {
                theObj.visibility = visible;
            }
        }
        else if (document.all) {
            if (visible == 'show') visible = 'visible';
            if (visible == 'hide') visible = 'hidden';
            theObj = eval("document.all[\'" + id + "\']");
            if (theObj) {
                theObj.style.visibility = visible;
            }
        }
    }
    function OnAddNewLevelClick() {
        var newName = document.getElementById("levelName").value;
        if (!newName || newName == "") {
            alert("等级名称不能空");
            return;
        }
        window.navigate("LevelOperation.aspx?action=a&name=" + newName);
    }
    function OnCancleLevelClick() {
        document.getElementById("levelName").value = "";
        CusExtWin('hide', 'boysoft');
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
        <asp:ObjectDataSource ID="SourceLevel" runat="server" 
            DataObjectTypeName="CustomerLevelDetail" DeleteMethod="DeleteEmployees" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetEmployees" 
            TypeName="CustomerLevelDB" UpdateMethod="UpdateEmployees"></asp:ObjectDataSource>
        <table width="730" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="34" style="background-image:../../images/bj2.gif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;等级操作</strong></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="center">
                    <asp:GridView ID="LevelGridView" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="SourceLevel" AllowPaging="True" BackColor="#DEBA84" 
                        BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                        CellSpacing="2" DataKeyNames="LevelId">
                        <Columns>
                            <asp:BoundField DataField="LevelId" HeaderText="LevelId" 
                                SortExpression="LevelId" Visible="False" />
                            <asp:TemplateField HeaderText="选择">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="LevelName" HeaderText="名称" 
                                SortExpression="LevelName" >
                            <HeaderStyle Width="180px" />
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FFF1D4" />
                        <SortedAscendingHeaderStyle BackColor="#B95C30" />
                        <SortedDescendingCellStyle BackColor="#F1E5CE" />
                        <SortedDescendingHeaderStyle BackColor="#93451F" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="center">
                    <asp:ImageButton ID="AddNewImageButton" runat="server" 
                        ImageUrl="~/images/an13.gif" OnClientClick="CusExtWin('show','boysoft');return false;" />
                    &nbsp;&nbsp;
                    <asp:ImageButton ID="DeleteImageButton" runat="server" 
                        ImageUrl="~/images/an14.gif" onclick="DeleteImageButton_Click" />
                </td>
            </tr>
            </table>

    <div id="boysoft" style="HEIGHT: 80px; LEFT: 309px; POSITION: absolute; TOP: 150px; VISIBILITY: hidden; WIDTH: 300px; Z-INDEX: 1"> 
      <table bgcolor="#666666" border="1" width="100%" style="height: 80px">
        <tbody> 
            <tr>
                <td height="65" width="100%"> 
                    <table width="99%" style="height: 80px">
                        <tbody> 
                          <tr> 
                            <td>新等级名称：</td>
                            <td><input id="levelName" type="text" /></td>
                          </tr>
                          <tr align="center"> 
                            <td height="23" width="100%">
                               <input id="AddLevelButton" onclick="OnAddNewLevelClick()" type="button" value="添加" />
                            </td>
                            <td height="23" width="100%">
                               <input id="CancleLevelButton" onclick="OnCancleLevelClick()" type="button" value="取消" />
                            </td>
                          </tr>
                        </tbody> 
                    </table>
                </td>
            </tr>
        </tbody> 
      </table>
    </div>
</asp:Content>

